home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 June / MacFormat 25.iso / Shareware City / Developers / Tools Plus 2.5.3 Evaluation Kit / Tools Plus 2.5.3 / Tools Plus 2.5.3 for C⁄C++ / ToolsPlus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-12  |  60.6 KB  |  1,227 lines  |  [TEXT/KAHL]

  1. /*  Tools Plus (Version 2.5.3) THINK C header file
  2.  *  Copyright (C) 1989-95 Water’s Edge Software
  3.  *
  4.  *  This header file defines all Tools Plus components (constants, variables and
  5.  *    structures).  Programs using Tools Plus must include this header file.
  6.  *
  7.  *    You must include the entire set of Tools Plus libraries and related files in
  8.  *    your project:
  9.  *        ToolsPlus.Lib1
  10.  *        ToolsPlus.Lib2
  11.  *        ToolsPlus.Lib3
  12.  *        ToolsPlus.c
  13.  *        ToolsPlus.h
  14.  */
  15.  
  16.  
  17. #ifndef __ToolsPlus__
  18. #define __ToolsPlus__
  19.  
  20.  
  21. #define        UseColor        true            /* INITIALIZATION: Use color if available        */
  22. #define        IgnoreColor        false            /*                   Don't use color                */
  23. #define        doNothing        0                /* POLLING:    no event                            */
  24. #define        doChgWindow        1                /*            user clicked in an inactive window    */
  25. #define        doRefresh        2                /*            a window has to be refreshed        */
  26. #define        doGoAway        3                /*            the close box was clicked            */
  27. #define        doButton        4                /*            button was clicked                    */
  28. #define        doMenu            5                /*            menu was selected                    */
  29. #define        doKeyDown        6                /*            a keyboard key was pressed            */
  30. #define        doAutoKey        7                /*            a keyboard key is auto-repeating    */
  31. #define        doKeyUp            8                /*            a keyboard key was released            */
  32. #define        doClickField    9                /*            mouse clicked in inactive field        */
  33. #define        doScrollBar        10                /*            mouse clicked in a scroll bar        */
  34. #define        doListBox        11                /*            some sort of List Box activity        */
  35. #define        doClick            12                /*            mouse click/drag [1..3]             */
  36. #define        doPopUpMenu        13                /*            pop-up menu was selected            */
  37. #define        doPictButton    14                /*            picture button activity                */
  38. #define        doClickControl    101                /*            mouse clicked in a custom control    */
  39. #define        doManualEvent    102                /*            manually processed events            */
  40. #define        doMoveWindow    103                /*            a window was dragged by user        */
  41. #define        doGrowWindow    104                /*            a window was "grown" by user        */
  42. #define        doClickDesk        105                /*            mouse clicked in the desk top        */
  43. #define        doZoomWindow    106                /*            zoom box was clicked by user        */
  44. #define        doSuspend        107                /*            appl. suspended (in background)        */
  45. #define        doResume        108                /*            appl. resumed (now active appl.)    */
  46. #define        doChgInField    109                /*            editing field contents was changed    */
  47. #define        doPreRefresh    110                /*            refresh window before T+ objects    */
  48. #define        inClick1        1                /* CLICK:    mouse single-click completed        */
  49. #define        inClick2        2                /*            mouse double-click completed        */
  50. #define        inClick3        3                /*            mouse triple-click completed        */
  51. #define        inClick1Drag    -1                /*            mouse single-click, still dragging    */
  52. #define        inClick2Drag    -2                /*            mouse double-click, still dragging    */
  53. #define        inClick3Drag    -3                /*            mouse triple-click, still dragging    */
  54. #define        EnterKey        (char)0x03        /* KEYS:    Key characters (ASCII) for the most    */
  55. #define        BackSpaceKey    (char)0x08        /*              commonly encountered keys.  In    */
  56. #define        TabKey            (char)0x09        /*              some cases, several keys produce    */
  57. #define        ReturnKey        (char)0x0D        /*              the same ASCII character.  They    */
  58. #define        EscClearKey        (char)0x1B        /* (0x1B)      may be differentiated by using    */
  59. #define        LeftArrowKey    (char)0x1C        /*               the key code, as indicated below.    */
  60. #define        RightArrowKey    (char)0x1D        /*              Some keys are available only on    */
  61. #define        UpArrowKey        (char)0x1E        /*              an "extended" keyboard.            */
  62. #define        DownArrowKey    (char)0x1F        /*                                                */
  63. #define        HelpKey            (char)0x05        /*                                                */
  64. #define        HomeKey            (char)0x01        /*                                                */
  65. #define        DeleteFwdKey    (char)0x7F        /*                                                */
  66. #define        EndKey            (char)0x04        /*                                                */
  67. #define        PageUpKey        (char)0x0B        /*                                                */
  68. #define        PageDownKey        (char)0x0C        /*                                                */
  69. #define        FKey            (char)0x10        /* (0x10)    Function keys "F1" to "F15"            */
  70. #define        EscKeyCode        0x35            /* (0x1B)    KEY CODES used to differentiate        */
  71. #define        ClearKeyCode    0x47            /* (0x1B)      between keys which produce the    */
  72. #define        F1KeyCode        0x7A            /* (0x10)      same key characters.                */
  73. #define        F2KeyCode        0x78            /*                                                */
  74. #define        F3KeyCode        0x63            /*                                                */
  75. #define        F4KeyCode        0x76            /*                                                */
  76. #define        F5KeyCode        0x60            /*                                                */
  77. #define        F6KeyCode        0x61            /*                                                */
  78. #define        F7KeyCode        0x62            /*                                                */
  79. #define        F8KeyCode        0x64            /*                                                */
  80. #define        F9KeyCode        0x65            /*                                                */
  81. #define        F10KeyCode        0x6D            /*                                                */
  82. #define        F11KeyCode        0x67            /*                                                */
  83. #define        F12KeyCode        0x6F            /*                                                */
  84. #define        F13KeyCode        0x69            /*                                                */
  85. #define        F14KeyCode        0x6B            /*                                                */
  86. #define        F15KeyCode        0x71            /*                                                */
  87. #define        mDividingLine    "\p-"            /* MENUS:    Dividing line                        */
  88. #define        AppleChar        (char)0x14        /* MENU CHARS:    Apple character                    */
  89. #define        CheckChar        (char)0x12        /*                Check Mark character            */
  90. #define        DiamondChar        (char)0x13        /*                Diamond character                */
  91. #define        DotChar            (char)0xA5        /*                Dot (or bullet) character        */
  92. #define        NoChar            (char)0x00        /*                no character                    */
  93.                                             /* PICTURE BUTTONS:                                */
  94. #define        picbutInstantEvent      0x80000000/*        Report event on mouse-down                */
  95. #define        picbutTrackWithHilite 0x40000000/*        Track using hiliting, like radio button    */
  96. #define        picbutLockSelected      0x20000000/*        Lock if selected (mouse can't deselect)    */
  97. #define        picbutSwitchSelected  0x10000000/*        Switch 'selected' state if clicked        */
  98. #define        picbutRepeatEvents      0x08000000/*        Repeat event when button is held down    */
  99. #define        picbutAutoValueChg      0x04000000/*        Automatically change button's value        */
  100. #define        picbutScaleLinear      0x00000000/*        Rate of automatic value change…            */
  101. #define        picbutScaleSlowAccel  0x01000000/*            Linear, Slow Acceleration,            */
  102. #define        picbutScaleMedAccel      0x02000000/*            Medium Acceleration, and            */
  103. #define        picbutScaleFastAccel  0x03000000/*            Fast Acceleration.                    */
  104. #define        picbutLinear          0x0        /*            Linear (use in structure)            */
  105. #define        picbutSlowAccel          0x1        /*            Slow (use in structure)                */
  106. #define        picbutMedAccel          0x2        /*            Medium (use in structure)            */
  107. #define        picbutFastAccel          0x3        /*            Fast (use in structure)                */
  108. #define        picbutValueWrap          0x00800000/*        Button's range of values 'wrap' around    */
  109. #define        picbutLeftRightSplit  0x00400000/*        Left side reduces value, right increases*/
  110. #define        picbutTopBottomSplit  0x00200000/*        Top increases value, bottom reduces        */
  111. #define        picbutMultiStage      0x00100000/*        Button has multiple stages                */
  112. #define        picbutBigSICN3D          0x00080000/*        Create a larger SICN 3D button            */
  113. #define        picbutUsePICTS          0x00040000/*        Use PICTs instead of icons                */
  114. #define        picbutGray4use8          0x00020000/*        Use 8-bit color pict on 4-bit gray CRT    */
  115.                                             /*      Selection Effects…                        */
  116. #define        picbutSelectDarken      0x00010000/*        Darken image                            */
  117. #define        picbutSelectDarkenSICN3D  0x00008000/*    Darken (and push in) a 3D SICN icon        */
  118. #define        picbutSelectLightenSICN3D 0x00004000/*    Lighten (and push in) a 3D SICN icon    */
  119. #define        picbutSelectPushedSICN3D  0x00002000/*    Same color (and push in) a 3D SICN icon    */
  120. #define        picbutSelectAltImage      0x00000400/*    Use an alternate image                    */
  121.                                                 /*Disabling Effects…                        */
  122. #define        picbutDimUsingBlackLite      0x00000100/*    Overlay Black color using Lt Gray pat.    */
  123. #define        picbutDimUsingWhiteLite      0x00000080/*    Overlay White color using Lt Gray pat.    */
  124. #define        picbutDimUsingWhite          0x00000040/*    Overlay White color using Gray pat.        */
  125. #define        picbutDimLeaveBorder      0x00000008/*    Leave border when applying effect        */
  126. #define        picbutDimAltImage          0x00000004/*    Use an alternate image                    */
  127. #define        picbutDimNoChange          0x00000002/*    Button looks the same when disabled        */
  128.                                             /* POP-UP MENUS:                                */
  129. #define        popupNeverDimOutline    0x0100    /*        Never dim the control's outline?        */
  130. #define        popupNeverDimSelection    0x0080    /*        Never dim the selected item's text?        */
  131. #define        popupNeverDimTitle        0x0040    /*        Never dim the title?                    */
  132. #define        popupNoArrow            0x0020    /*        Is the "down arrow" hidden?                */
  133. #define        popupMultiSelect        0x0010    /*        Allow multiple items to be selected?    */
  134. #define        popupUseWFont            0x0008    /*        Use the window's font for the menu?        */
  135. #define        popupIconTitle            0x0004    /*        Draw icon in the control's title?        */
  136. #define        popupFixedTitle            0x0002    /*        Is fixed title displayed in the control?*/
  137. #define     popupDefaultType        0x0000    /*        Default menu (sys font, 1 item, no icon)*/
  138. #define        arrowCursor        0                /* CURSORS:    "arrow" cursor                        */
  139. #define        GoAway            true            /* WINDOWS:    no "close box"                        */
  140. #define        NoGoAway        false            /*            window has a "close box"            */
  141. #define        Modal            true            /*            window is "modal"                    */
  142. #define        NotModal        false            /*            window is not "modal                */
  143. #define        ZoomBox         8                /*            zoom box (add to procID)            */
  144. #define        wCenter         0x00010000        /*            auto-centering (add to procID)        */
  145. #define        wTile           0x00020000        /*            auto-tiling (add to procID)            */
  146. #define        wPalette        0x80000000        /*            palette behavior (add to procID)    */
  147. #define        ordPaletteProc  32000            /*            window that looks like Palette        */
  148. #define        paletteProc        32000 + wPalette/*            T+’s Floating Palette window        */
  149. #define        altPaletteProc    32002 + wPalette/*            T+’s palette with drag bar on left    */
  150. #define        wNoKind            0                /*        Kinds of Windows:    Not open            */
  151. #define        wToolBarKind    1                /*                            Tool Bar            */
  152. #define        wFloatingKind    2                /*                            Floating Palette    */
  153. #define        wStandardKind    3                /*                            Standard Window        */
  154. #define        wAnimateMove        0x01        /*      Moving Windows:    Animate w/Zoom Lines    */
  155. #define        wOffsetForToolBar    0x02        /*                        Offset co-ords for TB    */
  156. #define        wShow                true        /*        Hiding Windows:    Display (unhide)        */
  157. #define        wHide                false        /*                        Hide window                */
  158. #define        tbShiftWindows        0x01        /*TOOL BAR:    Shift windows when TB opens            */
  159. #define        tbOffsetNewWindows    0x02        /*            Offset new windows as they are        */
  160.                                             /*                opened (if Tool Bar is open).    */
  161. #define        DefaultButton    4                /* BUTTONS:    "default" for the window            */
  162. #define        selected        true            /*            button is selected (ie: checked)    */
  163. #define        notSelected        false            /*            button is not selected                */
  164. #define        scrlLeftEdge    -1                /* SCROLL BARS:    left edge of document            */
  165. #define        scrlTopEdge        -1                /*                top edge of document            */
  166. #define        scrlRightEdge    32767            /*                right edge of document            */
  167. #define        scrlBottomEdge    32767            /*                bottom edge of document            */
  168.                                             /* BUTTONS, MENUS, SCROLL BARS & ICONS:            */
  169. #define        enabled            true            /*            enabled (active)                    */
  170. #define        disabled        false            /*            disabled (dim, inactive)            */
  171. #define        teBoxNoCR        0                /* EDIT FIELDS:    box around field, no CR allowed    */
  172. #define        teBoxCR            1                /*                box around field, CR allowed    */
  173. #define        teNoBoxNoCR        2                /*                no box, no CR allowed            */
  174. #define        teNoBoxCR        3                /*                no box, CR allowed                */
  175. #define        teSelectAll        0                /* EDIT FIELD SELECTION: all of text            */
  176. #define        teSelectStart    1                /*                         beginning of text        */
  177. #define        teSelectEnd        2                /*                         end of text            */
  178. #define        teReplace        true            /* PASTE INTO FIELD: replace field contents        */
  179. #define        teInsert        false            /*                     insert text into field        */
  180. #define        OkAltBut        1                /* ALERTS:    OK                (Buttons)            */
  181. #define        CanAltBut        2                /*            Cancel                                */
  182. #define        YesAltBut        3                /*            Yes                                    */
  183. #define        NoAltBut        4                /*            No                                    */
  184. #define        ContAltBut        5                /*            Continue                            */
  185. #define        SkipAltBut        6                /*            Skip                                */
  186. #define        QuitAltBut        7                /*            Quit                                */
  187. #define        NoButtonAlert    0                /*            No buttons        (Combinations)        */
  188. #define        OkAlert            11100            /*            OK (default)                        */
  189. #define        CanAlert        11200            /*            Cancel (default)                    */
  190. #define        OkCanAlert        22210            /*            OK (default) + Cancel                */
  191. #define        CanOkAlert        21210            /*            OK + Cancel (default)                */
  192. #define        YesNoAlert        22430            /*            Yes (default) + No                    */
  193. #define        NoYesAlert        21430            /*            Yes + No (default)                     */
  194. #define        YesNoCanAlert    33243            /*            Yes (default) + No + Cancel            */
  195. #define        NoYesCanAlert    32243            /*            Yes + No (default) + Cancel            */
  196. #define        nmSysBeep        -1                /* NOTIFICATION: Use System Error sound            */
  197. #define        nmSilentNote    0                /*                 Silent notification            */
  198. #define        nmDefaultMsg    "\p "            /*                 Use default message            */
  199. #define        nmNoMsg            "\p"            /*                 Don't display an alert            */
  200. #define        nmResetWhenDone    true            /*                 Reset to defaults after used    */
  201. #define        nmKeepSettings    false            /*                 Keep settings after used        */
  202. #define        NoIcon            -32768            /* ICONS:    No icon used                        */
  203.                                             /*        Disabled icons' default appearance…        */
  204. #define        DfltIconDimBlackLtPat 0x01        /*        Overlay Black color w/ Lt Gray pattern    */
  205. #define        DfltIconDimWhiteLtPat 0x02        /*        Overlay White color w/ Lt Gray pattern    */
  206. #define        DfltIconDimWhitePat      0x04        /*        Overlay White color w/ Gray pattern        */
  207. #define        DfltIconLeaveBorder      0x20        /*      Leave border when selected or disabled    */
  208. #define        DfltIconUpdateNow   0x8000        /*      Update all windows with changes            */
  209. #define        on                true            /* MISCELLANEOUS:                                */
  210. #define        off                false            /*                                                */
  211. #define        maxNullTime        0x7FFFFFFF        /*            Infinite time between doNothing evts*/
  212. #define        ZoomAcross        0                /* ZOOM LINES: transitional                        */
  213. #define        ZoomIn            -1                /*               zoom inward (further away)        */
  214. #define        ZoomOut            1                /*               zoom outward (nearer)            */
  215. #define        none            0                /* used primarily for polling                    */
  216.  
  217.  
  218.  
  219.  
  220.  
  221. /* - - - - - - These record "types" are used for information transfer between - - - - - - -    */
  222. /*                         your application and Tools Plus libraries.                            */
  223.  
  224. /*= Polling record's "event modifiers" info*/
  225.   union TPModifiersRec {                    /*This variable record contains an event's        */
  226.                                             /*    "modifiers" in 2 formats…                    */
  227.                                             /*    • Macintosh Event:                            */
  228.         short Num;                            /*        short (bit operations required)            */
  229.         struct {                            /*    • Modifier short parsed into components:    */
  230.             unsigned short bit15 :1;        /*        (reserved bit)                            */
  231.             unsigned short bit14 :1;        /*        (reserved bit)                            */
  232.             unsigned short bit13 :1;        /*        (reserved bit)                            */
  233.             unsigned short ControlKey :1;    /*        Control key was down at event (=1)        */
  234.             unsigned short OptionKey :1;    /*        Option key was down at event (=1)        */
  235.             unsigned short CapsLock :1;        /*        Caps Lock was down at event (=1)        */
  236.             unsigned short ShiftKey :1;        /*        Shift key was down at event (=1)        */
  237.             unsigned short CmdKey :1;        /*        Command key was down at event (=1)        */
  238.             unsigned short MouseUp :1;        /*        Mouse button was UP at event (=1)        */
  239.             unsigned short bit6 :1;            /*        (reserved bit)                            */
  240.             unsigned short bit5 :1;            /*        (reserved bit)                            */
  241.             unsigned short bit4 :1;            /*        (reserved bit)                            */
  242.             unsigned short bit3 :1;            /*        (reserved bit)                            */
  243.             unsigned short bit2 :1;            /*        (reserved bit)                            */
  244.             unsigned short bit1 :1;            /*        (reserved bit)                            */
  245.             unsigned short bit0 :1;            /*        (reserved bit)                            */
  246.         } Bits;                                /*                                                */
  247.     };
  248.     typedef union TPModifiersRec TPModifiersRec;
  249. /*= Polling record's "button" info*/
  250.       struct TPPollButtonRec {
  251.         short Num;                            /*Button number                                    */
  252.         Boolean DoubleClick;                /*Did a double-click occur?                        */
  253.     };
  254.     typedef struct TPPollButtonRec TPPollButtonRec;
  255. /*= Polling record's "scroll bar" info*/
  256.       struct TPPollScrollBarRec {
  257.         short Num;                            /*Scroll bar number                                */
  258.         short Part;                            /*Scroll bar's part                                */
  259.     };
  260.     typedef struct TPPollScrollBarRec TPPollScrollBarRec;
  261. /*= Polling record's "list box" info*/
  262.     struct TPPollListBoxRec {
  263.         short Num;                            /*List box number                                */
  264.         Boolean DoubleClick;                /*Did a double-click occur?                        */
  265.     };
  266.     typedef struct TPPollListBoxRec TPPollListBoxRec;
  267. /*= Polling record's "menu" info*/
  268.     struct TPPollMenuRec {
  269.         short Num;                            /*Menu number                                    */
  270.         short Item;                            /*Menu item number                                */
  271.     };
  272.     typedef struct TPPollMenuRec TPPollMenuRec;
  273. /*= Polling record's "key-stroke" info*/
  274.     struct TPPollKeyRec {
  275.         short Code;                            /*Logical key number of the typed key            */
  276.         char Chr;                            /*ASCII character generated by typed key        */
  277.         Byte Unused;                        /* (reserved byte)                                */                
  278.     };
  279.     typedef struct TPPollKeyRec TPPollKeyRec;
  280. /*= Polling record's "mouse location and time" info for mouse-down and mouse-up events*/
  281.     struct TPPollMousePointRec {
  282.         Point Where;                        /*Event location in local co-ordinates            */
  283.         long When;                            /*Event time in clock ticks from boot (1/60 sec)*/
  284.         TPModifiersRec Modifiers;            /*Event modifiers                                */
  285.     };
  286.     typedef struct TPPollMousePointRec TPPollMousePointRec;
  287. /*= Polling record's "mouse click/drag" info*/
  288.     struct TPPollMouseRec {
  289.         short What;                            /*What type of mouse event? (click or drag)        */
  290.         TPPollMousePointRec Down[3];        /*Where & when did the mouse-down occur            */
  291.         TPPollMousePointRec Up[3];            /*Where & when did the mouse-up occur            */
  292.         Point Where;                        /*Current mouse location in local co-ordinates    */
  293.     };
  294.     typedef struct TPPollMouseRec TPPollMouseRec;
  295. /*= POLLING record for Tools Plus*/
  296.     struct TPPollRecord {                    /*Tools Plus Polling record…                    */
  297.         short What;                            /*What type of event has occurred?                */
  298.         short Window;                        /*Window number of the event                    */
  299.         TPPollButtonRec Button;                /*Button number/double-click status                */
  300.         TPPollScrollBarRec ScrollBar;        /*Scroll bar number/scroll bar part                */
  301.         short Field;                        /*Field number of event                            */
  302.         TPPollListBoxRec ListBox;            /*List box number/double-click status            */
  303.         TPPollMenuRec Menu;                    /*Menu number/menu item of an event                */
  304.         TPPollKeyRec Key;                    /*Logical key number & character of typed key    */
  305.         TPPollMouseRec Mouse;                /*Click/drag info: [1..3] where & when            */
  306.         TPModifiersRec Modifiers;            /*Modifier flags                                */
  307.         EventRecord Event;                    /*Macintosh Toolbox Event (raw)                    */
  308.     };
  309.     typedef struct TPPollRecord TPPollRecord;
  310.     typedef TPPollRecord *TPPollPointer;    /*Pointer to a Polling record                    */
  311.  
  312.  
  313. /*= WINDOW status information*/
  314.     struct TPWindowStatus {
  315.         short Kind;                            /*Window kind: Tool Bar, Palette, or Standard    */
  316.         Boolean Open;                        /*Is the window open?                            */
  317.         Boolean Visible;                    /*Is this window visible (not hidden)?            */
  318.         Boolean Active;                        /*Is this window active?                        */
  319.         Boolean Front;                        /*Is this the frontmost Tools Plus window?        */
  320.         Boolean Current;                    /*Is this the current window?                    */
  321.         Boolean WorkWindow;                    /*Is this the work window?                        */
  322.         Boolean EditFieldWindow;            /*Does this window have app's active field?        */
  323.         short ActiveField;                    /*Window's active field number                    */
  324.         Rect StrucRect;                        /*Structure rect (global). Incl border&title bar*/
  325.         Rect ContRect;                        /*Content rect (global).  Working area only.    */
  326.     };
  327.     typedef struct TPWindowStatus TPWindowStatus;
  328.  
  329.  
  330. /*= Color Pen information*/
  331.     struct ColorPenState {                    /*Color equivalent for a 'PenState' record.        */
  332.         PenState PenState;                    /*    This record also stores additional values    */
  333.         RGBColor ForegroundColor;            /*    for the window's foreground and background    */
  334.         RGBColor BackgroundColor;            /*    colors.                                        */
  335.     };
  336.     typedef struct ColorPenState ColorPenState;
  337.  
  338.  
  339. /*= Picture Button Appearance & Behavior Specification (or you can use constants instead)    */
  340.     union TPPictButtonSpec {                        /*Picture Button's appearance and        */
  341.                                                     /*    behavior specs in 2 formats…        */
  342.         struct{                                        /* • Parsed into components:            */
  343.             unsigned short InstantEvent: 1;            /*        Report event on mouse-down        */
  344.             unsigned short TrackWithHilite: 1;        /*        Track using hiliting (like a    */
  345.                                                     /*            radio button)                */
  346.             unsigned short LockSelected: 1;            /*        Lock if selected (mouse can't    */
  347.                                                     /*            deselect)                    */
  348.             unsigned short SwitchSelected: 1;        /*        Switch 'select' state if clicked*/
  349.             unsigned short RepeatEvents: 1;            /*        Repeat event when button is held*/
  350.             unsigned short AutoValueChg: 1;            /*        Automatically chg button's value*/
  351.             unsigned short AutoValueScaling: 3;        /*        Rate of chg for button's value    */
  352.             unsigned short ValueWrap: 1;            /*        Button's range of values 'wrap'    */
  353.                                                     /*            around.                        */
  354.             unsigned short LeftRightSplit: 1;        /*        Left side reduces value, right    */
  355.                                                     /*            increases.                    */
  356.             unsigned short TopBottomSplit: 1;        /*        Top increases value, bottom        */
  357.                                                     /*            reduces.                    */
  358.             unsigned short MultiStage: 1;            /*        Button has multiple stages        */
  359.             unsigned short BigSICN3D: 1;            /*        Create a larger SICN 3D button    */
  360.             unsigned short UsePICTS: 1;                /*        Use PICTs instead of icons        */
  361.             unsigned short Gray4use8: 1;            /*        Use 8-bit color pict on 4-bit    */
  362.                                                     /*            gray monitor.                */
  363.                                                     /*    Selection Effects…                    */
  364.             unsigned short SelectDarken: 1;            /*        Darken image                    */
  365.             unsigned short SelectDarkenSICN3D: 1;    /*        Darken (+push in) a 3D SICN icon*/
  366.             unsigned short SelectLightenSICN3D: 1;    /*        Lighten (+push in) 3D SICN icon    */
  367.             unsigned short SelectPushedSICN3D: 1;    /*        Same color (+push) 3D SICN icon    */
  368.             unsigned short bit19: 1;                /*           (reserved bit)                */
  369.             unsigned short bit20: 1;                /*           (reserved bit)                */
  370.             unsigned short SelectAltImage: 1;        /*        Use an alternate image            */
  371.             unsigned short bit22: 1;                /*           (reserved bit)                */
  372.                                                     /*   Disabling Effects…                    */
  373.             unsigned short DimUsingBlackLite: 1;    /*        Overlay Black color, Lt Gray pat*/
  374.             unsigned short DimUsingWhiteLite: 1;    /*        Overlay White color, Lt Gray pat*/
  375.             unsigned short DimUsingWhite: 1;        /*        Overlay White color, Gray pat.    */
  376.             unsigned short bit26: 1;                /*           (reserved bit)                */
  377.             unsigned short bit27: 1;                /*           (reserved bit)                */
  378.             unsigned short DimLeaveBorder: 1;        /*        Leave border when effect applied*/
  379.             unsigned short DimAltImage: 1;            /*        Use an alternate image            */
  380.             unsigned short DimNoChange: 1;            /*        Button looks same when disabled    */
  381.             unsigned short bit31: 1;                /*           (reserved bit)                */
  382.         } Bits;                                        /*                                        */
  383.         long Num;                                    /* • Long equivalent                    */
  384.     };                                                /*                                        */
  385.     typedef union TPPictButtonSpec TPPictButtonSpec;
  386.  
  387.  
  388. /*= Pop-Up Menu Appearance & Behavior Specification (or you can use constants instead)        */
  389.     union TPPopUpMenuSpec {                            /*Pop-Up Menu's appearance and behavior    */
  390.                                                     /*    specifications in 2 formats…        */
  391.         struct{                                        /* • Parsed into components:            */
  392.             unsigned short bit15 :1;                /*        (reserved bit)                    */
  393.             unsigned short bit14 :1;                /*        (reserved bit)                    */
  394.             unsigned short bit13 :1;                /*        (reserved bit)                    */
  395.             unsigned short bit12 :1;                /*        (reserved bit)                    */
  396.             unsigned short bit11 :1;                /*        (reserved bit)                    */
  397.             unsigned short bit10 :1;                /*        (reserved bit)                    */
  398.             unsigned short bit9 :1;                    /*        (reserved bit)                    */
  399.             unsigned short NeverDimOutline :1;        /*     Never dim the control's outline?    */
  400.             unsigned short NeverDimSelectedItem: 1;    /*     Never dim the selected item's text?*/
  401.             unsigned short NeverDimTitle: 1;        /*     Never dim the title?                */
  402.             unsigned short NoArrow: 1;                /*     Is the "down arrow" hidden?        */
  403.             unsigned short MultipleSelections: 1;    /*     Allow multiple items to be selected*/
  404.             unsigned short useWFont: 1;                /*     Display using window's font?        */
  405.             unsigned short IconInTitle: 1;            /*     Draw icon in the control's title?    */
  406.             unsigned short FixedTitle: 1;            /*     Display fixed title in the control?*/
  407.             unsigned short bit0 :1;                    /*        (reserved bit)                    */
  408.         } Bits;                                        /*                                        */
  409.         short Num;                                    /* • Short equivalent                    */
  410.     };                                                /*                                        */
  411.     typedef union TPPopUpMenuSpec TPPopUpMenuSpec;
  412.  
  413.  
  414.  
  415.  
  416.  
  417. #ifdef __cplusplus
  418. extern "C" {
  419. #endif
  420.  
  421. /*======================================== I N I T I A L I Z A T I O N ========================================    */
  422. /*Initialize Tools Plus*/
  423.     pascal Boolean InitToolsPlus (short MoreHandles,            /*Number of MoreMasters initializing cycles        */
  424.                                     short MaxWindows,            /*Maximum number of windows required            */
  425.                                     Boolean UseColorFlag         /*Should Color QuickDraw be used if available?    */
  426.                                     );                            /* = Was initialization successful?                */
  427.  
  428.  
  429.  
  430. /*=============================================== W I N D O W S ===============================================    */
  431. /*Open a window and make it current*/
  432.     pascal void WindowOpen (short Window,                        /*Window number                                    */
  433.                                     short left,                    /*Window's co-ordinates (global)                */
  434.                                     short top,                    /*                                                */
  435.                                     short right,                /*                                                */
  436.                                     short bottom,                /*                                                */
  437.                                     Str255 Title,                /*Window's title (if applicable)                */
  438.                                     long procID,                /*Window definition ID                            */
  439.                                     Boolean goAwayFlag,            /*Include Close Box?                            */
  440.                                     Boolean modalFlag);            /*Is window modal?                                */
  441.  
  442. /*Open a window and make it current (co-ordinates specified as a 'rect') */
  443.     pascal void WindowOpenRect (short Window,                    /*Window number                                    */
  444.                                     Rect *Bounds,                /*Window's co-ordinates (global)                */
  445.                                     Str255 Title,                /*Window's title (if applicable)                */
  446.                                     long procID,                /*Window definition ID                            */
  447.                                     Boolean goAwayFlag,            /*Include Close Box?                            */
  448.                                     Boolean modalFlag);            /*Is window modal?                                */
  449.  
  450. /*Open the tool bar and make it current*/
  451.     pascal void ToolBarOpen (short Window,                        /*Window number                                    */
  452.                                     short Height,                /*Tool bar height                                */
  453.                                     short procID);                /*Appearance/behavior specifications            */
  454.  
  455. /*Close a window*/
  456.     pascal void WindowClose (short Window);                        /*Window number                                    */
  457.  
  458. /*Change a window's size*/
  459.     pascal void WindowSize (short Window,                        /*Window number                                    */
  460.                                     short Width,                /*Window's new width                            */                    
  461.                                     short Height,                /*Window's new height                            */
  462.                                     Boolean Update);            /*Force doRefresh event for newly exposed rgn?    */
  463.  
  464. /*Move a window to the specified co-ordinates*/
  465.     pascal void WindowMove (short Window,                        /*Window number                                    */
  466.                                     short hGlobal,                /*Horizontal co-ordinates (global)                */
  467.                                     short vGlobal,                /*Vertical co-ordinates (global)                */
  468.                                     short procID);                /*Behavior specifications                        */
  469.  
  470. /*Hide or show a window*/
  471.     pascal void WindowDisplay (short Window,                    /*Window number                                    */
  472.                                     Boolean Show);                /*Should the window be shown?                    */
  473.  
  474. /*Make a specified window the "active" and "current" window*/
  475.     pascal void ActivateWindow (short Window);                    /*Window number                                    */
  476.  
  477. /*Set a window's title*/
  478.     pascal void WindowTitle (short Window,                        /*Window number                                    */
  479.                                     Str255 Title);                /*Window's title (if applicable)                */
  480.  
  481. /*Set the current window's "growing" limits (ie: maximum/minimum size) */
  482.     pascal void SetWindowSizeLimits (short minHoriz,            /*Window's size limits in pixels                */
  483.                                     short minVert,                /*                                                */
  484.                                     short maxHoriz,                /*                                                */
  485.                                     short MaxVert);                /*                                                */
  486.  
  487. /*Set the current window's standard co-ordinates and user co-ordinates for "zooming"*/
  488.     pascal void SetWindowZoom (Rect *userRect, Rect *stdRect);    /*User & standard co-ordinates (global)            */
  489.  
  490. /*Get the current window's user co-ordinates & standard co-ordinates for "zooming"*/
  491.     pascal void GetWindowZoom (Rect *userRect, Rect *stdRect);    /*User & standard co-ordinates (global)            */
  492.  
  493. /*Make a specified window "current", but do not activate it*/
  494.     pascal void CurrentWindow (short Window);                    /*Window number                                    */
  495.  
  496. /*Make the "active" window the "current"*/
  497.     pascal void CurrentWindowReset(void);
  498.  
  499. /*Get a window's status*/
  500.     pascal void WindowStatus (short Window,                        /*Window number                                    */
  501.                                     TPWindowStatus *Status);    /*Window's status record                        */
  502.  
  503. /*Get the active window number (last used window if Tool Bar and/or Floating Palettes are open)    */
  504.     pascal short ActiveWindowNumber(void);                        /*Window number of active window                */
  505.  
  506. /*Get the current window number*/
  507.     pascal short CurrentWindowNumber(void);                        /*Window number of current window                */
  508.  
  509. /*Get the front most window number*/
  510.     pascal short FirstWindowNumber(void);                        /*Window number of front most window            */
  511.  
  512. /*Get the Tool Bar's window number*/
  513.     pascal short ToolBarNumber(void);                            /*Tool Bar's window number                        */
  514.  
  515. /*Get the first floating Palette's window number*/
  516.     pascal short FirstPaletteNumber(void);                        /*Front most floating Palette's window number    */
  517.  
  518. /*Get the first standard window's number (not Tool Bar or Floating Palette).*/
  519.     pascal short FirstStdWindowNumber(void);                    /*Front most standard window's number            */
  520.  
  521. /*Get the working window number*/
  522.     pascal short WorkWindowNumber(void);                        /*Working window number                            */
  523.  
  524. /*Get the window number that contains the active editing field*/
  525.     pascal short EditFldWindowNumber(void);                        /*Window number containing active editing field    */
  526.  
  527. /*Determine if a window is open*/
  528.     pascal Boolean WindowIsOpen (short Window                    /*Window number                                    */
  529.                                     );                            /* = Is the window open?                        */
  530.  
  531. /*Determine if a window is visible (open and not hidden)*/
  532.     pascal Boolean WindowIsVisible (short Window                /*Window number                                    */
  533.                                       );                            /* = Is the window visible?                        */
  534.  
  535. /*Determine the type of window*/
  536.     pascal short WindowKind (short Window                        /*Window number                                    */
  537.                                        );                            /* = Kind of window                                */
  538.  
  539. /*Get a window's "window pointer" */
  540.     pascal WindowPtr WindowPointer (short Window                /*Window number                                    */
  541.                                     );                             /* = Window's pointer                            */
  542.  
  543.  
  544.  
  545. /*=============================================== B U T T O N S ===============================================    */
  546. /*Create a new button*/
  547.     pascal void NewButton (short Button,                        /*Button number                                    */
  548.                                     short left,                    /*Button's co-ordinates (local)                    */
  549.                                     short top,                    /*                                                */
  550.                                     short right,                /*                                                */
  551.                                     short bottom,                /*                                                */
  552.                                     Str255 Title,                /*Button's title                                */
  553.                                     short procID,                /*Button's definition ID                        */
  554.                                     Boolean EnabledFlag,        /*Enable the button?                            */
  555.                                     Boolean SelectedFlag);        /*Select the button?                            */
  556.  
  557. /*Create a new button (co-ordinates specified as a 'rect') */
  558.     pascal void NewButtonRect (short Button,                    /*Button number                                    */
  559.                                     Rect *Bounds,                /*Button's co-ordinates (local)                    */
  560.                                     Str255 Title,                /*Button's title                                */
  561.                                     short procID,                /*Button's definition ID                        */
  562.                                     Boolean EnabledFlag,        /*Enable the button?                            */
  563.                                     Boolean SelectedFlag);        /*Select the button?                            */
  564.  
  565. /*Delete a button*/
  566.     pascal void DeleteButton (short Button);                    /*Button number                                    */
  567.  
  568. /*Enable/disable a button*/
  569.     pascal void EnableButton (short Button,                        /*Button number                                    */
  570.                                     Boolean EnabledFlag);        /*Enable the button?                            */
  571.  
  572. /*Select/deselect a button*/
  573.     pascal void SelectButton (short Button,                        /*Button number                                    */
  574.                                     Boolean SelectedFlag);        /*Select the button?                            */
  575.  
  576. /*Determine if a button is enabled*/
  577.     pascal Boolean ButtonIsEnabled (short Button                /*Button number                                    */
  578.                                     );                            /* = Is the button enabled?                        */
  579.  
  580. /*Determine if a button is selected*/
  581.     pascal Boolean ButtonIsSelected (short Button                /*Button number                                    */
  582.                                     );                            /* = Is the button selected?                    */
  583.  
  584. /*Set a button's title*/
  585.     pascal void ButtonTitle (short Button,                        /*Button number                                    */
  586.                                     Str255 Title);                /*Button's title                                */
  587.  
  588. /*Make a button the window's default button*/
  589.     pascal void SetDefaultButton (short Button);                /*Button number                                    */
  590.  
  591. /*Remove the "default button status" from the window's default button*/
  592.     pascal void NoDefaultButton(void);
  593.  
  594. /*"Flash" a push button as though it were pressed by the user*/
  595.     pascal void FlashButton (short Button);                        /*Button number                                    */
  596.  
  597.  
  598.  
  599. /*======================================= P I C T U R E   B U T T O N S ======================================    */
  600. /*Create a new Picture Button*/
  601.     pascal void NewPictButton (short Button,                    /*Picture button number                            */
  602.                                     short left,                    /*Button's top-left corner in window's local    */
  603.                                     short top,                    /*    co-ordinates.                                */
  604.                                     short BaseID,                /*Base image's ID number                        */
  605.                                     long procID,                /*Appearance and Behavior specifications        */
  606.                                     Boolean EnabledFlag,        /*"Button is enabled" flag                        */
  607.                                     Boolean SelectedFlag,        /*"Button is selected" flag                        */
  608.                                     short minimum,                /*Minimum limit of button's value                */
  609.                                     short value,                /*Button's value                                */
  610.                                     short maximum);                /*Maximum limit of button's value                */
  611.  
  612. /*Delete a picture button*/
  613.     pascal void DeletePictButton (short Button);                /*Picture button number                            */
  614.  
  615. /*Enable/disable a picture button*/
  616.     pascal void EnablePictButton (short Button,                    /*Picture button number                            */
  617.                                     Boolean EnabledFlag);        /*Enable the picture button?                    */
  618.  
  619. /*Select/deselect a picture button*/
  620.     pascal void SelectPictButton (short Button,                    /*Picture button number                            */
  621.                                     Boolean SelectedFlag);        /*Select the picture button?                    */
  622.  
  623. /*Get a picture button's minimum setting*/
  624.     pascal short GetPictButtonMin (short Button                    /*Picture button number                            */
  625.                                     );                            /* = Picture button's minimum setting            */
  626.  
  627. /*Set a picture button's minimum setting*/
  628.     pascal void SetPictButtonMin (short Button,                    /*Picture button number                            */
  629.                                     short minimum);                /*Picture button's minimum setting                */
  630.  
  631. /*Get a picture button's maximum setting*/
  632.     pascal short GetPictButtonMax (short Button                    /*Picture button number                            */
  633.                                     );                            /* = Picture button's maximum setting            */
  634.  
  635. /*Set a picture button's maximum setting*/
  636.     pascal void SetPictButtonMax (short Button,                    /*Picture button number                            */
  637.                                     short maximum);                /* = Picture button's maximum setting            */
  638.  
  639. /*Get a picture button's current value*/
  640.     pascal short GetPictButtonVal (short Button                    /*Picture button number                            */
  641.                                     );                            /* = Picture button's current value                */
  642.  
  643. /*Set a picture button's current value*/
  644.     pascal void SetPictButtonVal (short Button,                    /*Picture button number                            */
  645.                                     short value);                /*Picture button's value                        */
  646.  
  647. /*Set a picture button's current value, and simultaneously select/deselect it*/
  648.     pascal void SetPictButtonValSelect (short Button,            /*Picture button number                            */
  649.                                     short value,                /*Picture button's value                        */
  650.                                     Boolean SelectedFlag);        /*Select the picture button?                    */
  651.  
  652. /*Set a picture button's value acceleration 'automatic value changing'*/
  653.     pascal void SetPictButtonAccel (short Button,                /*Picture button number                            */
  654.                                     short Rate);                /*0 = Linear, 1-3 = Slow to fast acceleration    */
  655.  
  656. /*Set a picture button's speed for 'automatic value changing'*/
  657.     pascal void SetPictButtonSpeed (short Button,                /*Picture button number                            */
  658.                                     short Rate);                /*Rate of change (value increment per second)    */
  659.  
  660. /*Determine if a picture button is enabled*/
  661.     pascal Boolean PictButtonIsEnabled (short Button            /*Picture button number                            */
  662.                                     );                            /* = Is the button enabled?                        */
  663.  
  664. /*Determine if a picture button is selected*/
  665.     pascal Boolean PictButtonIsSelected (short Button            /*Picture button number                            */
  666.                                     );                            /* = Is the button selected?                    */
  667.  
  668. /*"Flash" a picture button as though it were pressed by the user*/
  669.     pascal void FlashPictButton (short Button);                    /*Picture button number                            */
  670.  
  671.  
  672.  
  673.  
  674. /*=========================================== S C R O L L   B A R S ===========================================    */
  675. /*Create a new scroll bar*/
  676.     pascal void NewScrollBar (short ScrollBar,                    /*Scroll bar number                                */
  677.                                     short left,                    /*Scroll bar's co-ordinates (local)                */
  678.                                     short top,                    /*                                                */
  679.                                     short right,                 /*                                                */
  680.                                     short bottom,                /*                                                */
  681.                                     Boolean EnabledFlag,        /*Enable the scroll bar?                        */
  682.                                     short minimum,                /*Minimum, current, and maximum value            */
  683.                                     short value,                /*                                                */
  684.                                     short maximum);                /*                                                */
  685.  
  686. /*Create a new scroll bar (co-ordinates specified as a 'rect') */
  687.     pascal void NewScrollBarRect (short ScrollBar,                /*Scroll bar number                                */
  688.                                     Rect *Bounds,                /*Scroll bar's co-ordinates (local)                */
  689.                                     Boolean EnabledFlag,        /*Enable the scroll bar?                        */
  690.                                     short minimum,                /*Minimum, current, and maximum value            */
  691.                                     short value,                /*                                                */
  692.                                     short maximum);                /*                                                */
  693.  
  694. /*Delete a scroll bar*/
  695.     pascal void DeleteScrollBar (short ScrollBar);                /*Scroll bar number                                */
  696.  
  697. /*Enable/disable a scroll bar*/
  698.     pascal void EnableScrollBar (short ScrollBar,                /*Scroll bar number                                */
  699.                                     Boolean EnabledFlag);        /*Enable the scroll bar?                        */
  700.  
  701. /*Get a scroll bar's minimum setting*/
  702.     pascal short GetScrollBarMin (short ScrollBar                /*Scroll bar number                                */
  703.                                     );                            /*Scroll bar's minimum setting                    */
  704.  
  705. /*Set a scroll bar's minimum setting*/
  706.     pascal void SetScrollBarMin (short ScrollBar,                /*Scroll bar number                                */
  707.                                     short minimum);                /*Scroll bar's minimum setting                    */
  708.  
  709. /*Get a scroll bar's maximum setting*/
  710.     pascal short GetScrollBarMax (short ScrollBar                /*Scroll bar number                                */
  711.                                     );                            /* = Scroll bar's maximum setting                */
  712.  
  713. /*Set a scroll bar's maximum setting*/
  714.     pascal void SetScrollBarMax (short ScrollBar,                /*Scroll bar number                                */
  715.                                     short maximum);                /*Scroll bar's maximum setting                    */
  716.  
  717. /*Get a scroll bar's current value*/
  718.     pascal short GetScrollBarVal (short ScrollBar                /*Scroll bar number                                */
  719.                                     );                             /* = Scroll bar's current value                    */
  720.  
  721. /*Set a scroll bar's current value*/
  722.     pascal void SetScrollBarVal (short ScrollBar,                /*Scroll bar number                                */
  723.                                     short value);                /*Scroll bar's current value                    */
  724.  
  725.  
  726.  
  727. /*======================================== E D I T I N G   F I E L D S ========================================    */
  728. /*Allocate heap storage for a Pascal string, and initialize it.*/
  729.     pascal StringHandle NewStrHandle (short StringLen            /*Size of string being allocated (1-255 chars)    */
  730.                                     );                            /*Handle to allocated string                    */
  731.  
  732. /*Create a new field*/
  733.     pascal void NewField (short Field,                            /*Field number                                    */
  734.                                     short left,                 /*Field's viewing area co-ordinates (local)        */
  735.                                     short top,                    /*                                                */
  736.                                     short right,                /*                                                */
  737.                                     short bottom,                /*                                                */
  738.                                     Handle hStr,                /*Handle to edit field's text                    */
  739.                                     short teType,                /*Type: box around field and/or CR allowed?        */
  740.                                     short Just);                /*Justification: left, centre, right                */
  741.  
  742. /*Create a new field (co-ordinates specified as a 'rect') */
  743.     pascal void NewFieldRect (short Field,                        /*Field number                                    */
  744.                                     Rect *Bounds,                 /*Field's viewing area co-ordinates (local)        */
  745.                                     Handle hStr,                /*Handle to edit field's text                    */
  746.                                     short teType,                /*Type: box around field and/or CR allowed?        */
  747.                                     short Just);                /*Justification: left, centre, right            */
  748.  
  749. /*Delete a field*/
  750.     pascal void DeleteField (short Field);                        /*Field number                                    */
  751.  
  752. /*Activate a  field*/
  753.     pascal void ActivateField (short Field,                        /*Field number                                    */
  754.                                     short Selection);            /*Text selection: all, start, end                */
  755.  
  756. /*Deactivate the active field*/
  757.     pascal void DeactivateField(void);
  758.  
  759. /*Process a mouse click in an inactive field.  The click has been detected by the PollSystem routine.*/
  760.     pascal void ClickInField(void);
  761.  
  762. /*Get the active field's edited text*/
  763.     pascal void GetFieldString (Str255 EditString);                /*Field's edited text                            */
  764.  
  765. /*Save the active field's edited text in the field's string*/
  766.     pascal void SaveFieldString(void);
  767.  
  768. /*Determine the active field number*/
  769.     pascal short ActiveFieldNumber(void);                        /*Active field number                            */
  770.  
  771. /*Determine if a field is empty*/
  772.     pascal Boolean FieldIsEmpty (short Field                    /*Field number                                    */
  773.                                     );                            /* = Is the specified field empty?                */
  774.  
  775. /*Turn string length limiting on/off for each new field created starting now*/
  776.     pascal void FieldLengthLimit (Boolean Limits);                /*Should newly created fields be length-limited?*/
  777.  
  778. /*Offset a field*/
  779.     pascal void OffsetField (short Field,                        /*Field number                                    */
  780.                                     short dh, short dv);        /*Number of pixels to be offset (horiz/vert)    */
  781.  
  782. /*Paste text into a field*/
  783.     pascal void PasteIntoField (short Field,                    /*Field number                                    */
  784.                                     Str255 Text,                /*Text which is to be pasted                    */
  785.                                     Boolean Replace);            /*Replace all existing text in field?            */
  786.  
  787.  
  788.  
  789. /*============================================ L I S T   B O X E S ============================================    */
  790. /*Create a new List Box*/
  791.     pascal void NewListBox (short ListBox,                        /*List box number                                */
  792.                                     short left,                    /*List box co-ordinates (local)                    */
  793.                                     short top,                    /*                                                */
  794.                                     short right,                /*                                                */
  795.                                     short bottom,                /*                                                */                        
  796.                                     SignedByte BoxType);        /*Type of responses to mouse clicks, shift-        */
  797.                                                                 /*    click, dragging, etc.                        */
  798.  
  799. /*Create a new List Box (co-ordinates specified as a 'rect') */
  800.     pascal void NewListBoxRect (short ListBox,                    /*List box number                                */
  801.                                     Rect *Bounds,                /*List box co-ordinates (local)                    */
  802.                                     SignedByte BoxType);        /*Type of responses to mouse clicks, shift-        */
  803.                                                                 /*    click, dragging, etc.                        */
  804.  
  805. /*Delete a List Box*/
  806.     pascal void DeleteListBox (short ListBox);                    /*List box number                                */
  807.  
  808. /*Set a line of text in a List Box*/
  809.     pascal void SetListBoxText (short ListBox,                    /*List box number                                */
  810.                                     short LineNum,                /*Line number                                    */
  811.                                     Str255 Text);                /*Text of specified line number                    */
  812.  
  813. /*Get a line of text from a List Box*/
  814.     pascal void GetListBoxText (short ListBox,                    /*List box number                                */
  815.                                     short LineNum,                /*Line number                                    */
  816.                                     Str255 Text);                /*Text of specified line number                    */
  817.  
  818. /*Get a List Box's line number whose text is greater than or equal to the specified string*/
  819.     pascal short SearchListBox (short ListBox,                    /*List box number                                */
  820.                                     Str255 Text                    /*Text being compared                            */
  821.                                     );                            /* = Line number of text                        */
  822.  
  823. /*Select/deselect a specified List Box line*/
  824.     pascal void SetListBoxLine (short ListBox,                    /*List box number                                */
  825.                                     short LineNum,                /*Line number                                    */
  826.                                     Boolean SetIt);                /*Selects the line?                                */
  827.  
  828. /*Determine if a specific List Box line is selected*/
  829.     pascal Boolean GetListBoxLine (short ListBox,                /*List box number                                */
  830.                                     short LineNum                /*Line number                                    */
  831.                                     );                            /* = Is the line selected?                        */
  832.  
  833. /*Get the line number of a selected line in a List Box, starting at LineNum and searching down*/
  834.     pascal short GetListBoxLines (short ListBox,                /*List box number                                */
  835.                                     short LineNum                /*Line number                                    */
  836.                                     );                            /* = Next selected line                            */
  837.  
  838. /*Insert a blank line into a List Box*/
  839.     pascal void InsertListBoxLine (short ListBox,                /*List box number                                */
  840.                                     short LineNum);                /*Line number                                    */
  841.  
  842. /*Delete a line from a List Box*/
  843.     pascal void DeleteListBoxLine (short ListBox,                /*List box number                                */
  844.                                     short LineNum);                /*Line number                                    */
  845.  
  846. /*Turn a List Box's text drawing on/off*/
  847.     pascal void DrawListBox (short ListBox,                        /*List box number                                */
  848.                                     Boolean DrawIt);            /*Draw the list box's text?                        */
  849.  
  850.  
  851.  
  852. /*================================================= M E N U S =================================================    */
  853. /*Create the "Apple" menu*/
  854.     pascal void AppleMenu (Str255 AboutName);                    /*Optional "About…" name                        */
  855.  
  856. /*Create a menu name, add/change a menu item, or rename an existing menu item*/
  857.     pascal void Menu (short MenuNumber,                            /*Menu number                                    */
  858.                                     short ItemNumber,            /*Item number within the menu                    */
  859.                                     Boolean EnabledFlag,        /*Enable the menu?                                */
  860.                                     Str255 MenuText);            /*Menu title or item name                        */
  861.  
  862. /*Attach a hierarchical menu to a menu item, or detach a hierarchical menu*/
  863.     pascal void AttachMenu (short MenuNumber,                    /*Menu number to which the submenu is attached    */
  864.                                     short ItemNumber,            /*Item number to which the submenu is attached    */
  865.                                     short SubMenuNumber);        /*Hierarchical menu number being attached        */
  866.  
  867. /*Insert a menu item*/
  868.     pascal void InsertMenuitem (short MenuNumber,                /*Menu number                                    */
  869.                                     short ItemNumber,            /*Item number where insertion is to be made        */
  870.                                     Boolean EnabledFlag,        /*Enable the menu?                                */
  871.                                     Str255 MenuText);            /*Item name                                        */
  872.  
  873. /*Remove an entire menu and its associated items, or a menu item*/
  874.     pascal void RemoveMenu (short MenuNumber,                    /*Menu number                                    */
  875.                                     short ItemNumber);            /*Item number within the menu (0=entire menu)    */
  876.  
  877. /*Display the menu bar after making changes through the Menu or RemoveMenu procedure*/
  878.     pascal void UpdateMenuBar(void);
  879.  
  880. /*Get a menu item's text*/
  881.     pascal void GetMenuString (short MenuNumber,                /*Menu number                                    */
  882.                                     short ItemNumber,            /*Item number within the menu                    */
  883.                                     Str255 MenuText);            /*Menu item's name                                */
  884.  
  885. /*Change the name of a menu item*/
  886.     pascal void RenameItem (short MenuNumber,                    /*Menu number                                    */
  887.                                     short ItemNumber,            /*Item number within the menu                    */
  888.                                     Str255 MenuText);            /*Menu item's name                                */
  889.  
  890. /*Enable/disable a menu or menu item*/
  891.     pascal void EnableMenu (short MenuNumber,                    /*Menu number                                    */
  892.                                     short ItemNumber,            /*Item number within the menu (or 0)            */
  893.                                     Boolean EnabledFlag);        /*Enable the menu or item?                        */
  894.  
  895. /*Display/remove a menu item's check mark*/
  896.     pascal void CheckMenu (short MenuNumber,                    /*Menu number                                    */
  897.                                     short ItemNumber,            /*Item number within the menu                    */
  898.                                     Boolean checked);            /*Place check mark beside the menu item?        */
  899.  
  900. /*Mark a menu item with a specified character (√ or •, etc)*/
  901.     pascal void MenuMark (short MenuNumber,                        /*Menu number                                    */
  902.                                     short ItemNumber,            /*Item number within the menu                    */
  903.                                     char markChar);                /*Menu item's character                            */
  904.  
  905. /*Get a menu item's ‘mark’ character (√ or •, etc) which is optionally displayed at the item's left side*/
  906.     pascal void GetMenuMark (short MenuNumber,                    /*Menu number                                    */
  907.                                     short ItemNumber,            /*Item number within the menu                    */
  908.                                     char *markChar);            /*Menu item's character                            */
  909.  
  910. /*Specify a keyboard equivalent for a menu item*/
  911.     pascal void MenuCmd (short MenuNumber,                        /*Menu number                                    */
  912.                                     short ItemNumber,            /*Item number within the menu                    */
  913.                                     char cmdChar);                /*Menu item's keyboard-equivalent character        */
  914.  
  915. /*Get a keyboard equivalent for a menu item*/
  916.     pascal void GetMenuCmd (short MenuNumber,                    /*Menu number                                    */
  917.                                     short ItemNumber,            /*Item number within the menu                    */
  918.                                     char *cmdChar);                /*Menu item's keyboard-equivalent character        */
  919.  
  920. /*Specify an icon to be displayed by a menu item*/
  921.     pascal void MenuIcon (short MenuNumber,                        /*Menu number                                    */
  922.                                     short ItemNumber,            /*Item number within the menu                    */
  923.                                     short IconSelector);        /*IconSelector + 256 = cicn or ICON ID            */
  924.  
  925. /*Get the specifier for the icon that is displayed by a menu item*/
  926.     pascal void GetMenuIcon (short MenuNumber,                    /*Menu number                                    */
  927.                                     short ItemNumber,            /*Item number within the menu                    */
  928.                                     short *IconSelector);        /*IconSelector + 256 = cicn or ICON ID            */
  929.  
  930. /*Set the character style for a menu item*/
  931.     pascal void MenuStyle (short MenuNumber,                    /*Menu number                                    */
  932.                                     short ItemNumber,            /*Item number within the menu                    */
  933.                                     Style theStyle);            /*Menu item's character style                    */
  934.  
  935. /*Determine the number of items in a menu*/
  936.     pascal short MenuItemCount (short MenuNumber                /*Menu number                                    */
  937.                                        );                            /* =Number of items in the menu                    */
  938.  
  939. /*Determine a menu's parent menu number*/
  940.      pascal void GetParentMenu (short *MenuNumber,                /*Parent menu's menu number                        */
  941.                                     short *ItemNumber,            /*Parent menu's item number                     */
  942.                                     short SubMenuNumber);        /*Menu number whose parent menu is determined    */
  943.  
  944. /*Determine a menu item's submenu number*/
  945.      pascal void GetSubMenu (short MenuNumber,                    /*Menu number                                    */
  946.                                     short ItemNumber,            /*Item number within the menu                    */
  947.                                     short *SubMenuNumber);        /*Menu number of this item's submenu            */
  948.  
  949. /*Highlight a menu in the menu bar, or turn off menu bar highlights*/
  950.     pascal void MenuHilite (short MenuNumber);                    /*Menu number                                    */
  951.  
  952.  
  953.  
  954. /*========================================== P O P - U P   M E N U S ==========================================    */
  955. /*Create a new Pop-Up menu*/
  956.     pascal void NewPopUp (short MenuNumber,                        /*Pop-Up Menu number                            */
  957.                                     short left,                    /*Enclosing rectangle co-ordinates (local)        */
  958.                                     short top,                    /*                                                */
  959.                                     short right,                /*                                                */
  960.                                     short bottom,                /*                                                */
  961.                                     Str255 MenuTitle,            /*Title                                            */
  962.                                     short procID,                /*Appearance and behavior specifications        */
  963.                                     Boolean EnabledFlag);        /*"Menu is enabled" flag                        */
  964.  
  965. /*Create a new Pop-Up menu (co-ordinates specified as a 'rect') */
  966.     pascal void NewPopUpRect (short MenuNumber,                    /*Pop-Up Menu number                            */
  967.                                     Rect *Bounds,                /*Enclosing rectangle co-ordinates (local)        */
  968.                                     Str255 Title,                /*Title                                            */
  969.                                     short procID,                /*Appearance and behavior specifications        */
  970.                                     Boolean EnabledFlag);        /*"Menu is enabled" flag                        */
  971.  
  972. /*Add or change a Pop-Up menu item, or rename an existing menu item*/
  973.     pascal void PopUpMenu (short MenuNumber,                    /*Pop-Up Menu number                            */
  974.                                     short ItemNumber,            /*Item number within the menu                    */
  975.                                     Boolean EnabledFlag,        /*Enable the menu?                                */
  976.                                     Str255 MenuText);            /*Item name                                        */
  977.  
  978. /*Insert a Pop-Up menu item in the "current" window*/
  979.     pascal void InsertPopUpItem (short MenuNumber,                /*Pop-Up Menu number                            */
  980.                                     short ItemNumber,            /*Item number where insertion is to be made        */
  981.                                     Boolean EnabledFlag,        /*Is menu item enabled?                            */
  982.                                     Str255 MenuText);            /*Item name                                        */
  983.  
  984. /*Remove an Pop-Up menu, or a Pop-Up menu item*/
  985.     pascal void RemovePopUp (short MenuNumber,                    /*Pop-Up Menu number                            */
  986.                                     short ItemNumber);            /*Item number within the menu (0=entire menu)    */
  987.  
  988. /*Get an Pop-Up Menu item's text*/
  989.     pascal void GetPopUpString (short MenuNumber,                /*Pop-Up Menu number                            */
  990.                                     short ItemNumber,            /*Item number within the menu                    */
  991.                                     Str255 MenuText);            /*Menu item's name                                */
  992.  
  993. /*Change the name of a Pop-Up Menu item*/
  994.     pascal void RenamePopUp (short MenuNumber,                    /*Pop-Up Menu number                            */
  995.                                     short ItemNumber,            /*Item number within the menu                    */
  996.                                     Str255 MenuText);            /*Menu item's name                                */
  997.  
  998. /*Enable/disable a Pop-Up Menu or menu item*/
  999.     pascal void EnablePopUp (short MenuNumber,                    /*Pop-Up Menu number                            */
  1000.                                     short ItemNumber,            /*Item number within the menu (or 0)            */
  1001.                                     Boolean EnabledFlag);        /*Enable the menu or item?                        */
  1002.  
  1003. /*Determine if a Pop-Up Menu is enabled*/
  1004.     pascal Boolean PopUpIsEnabled (short MenuNumber                /*Pop-Up Menu number                            */
  1005.                                     );                            /* = Is the menu enabled?                        */
  1006.  
  1007. /*Display/remove a Pop-Up Menu item's check mark*/
  1008.     pascal void CheckPopUp (short MenuNumber,                    /*Pop-Up Menu number                            */
  1009.                                     short ItemNumber,            /*Item number within the menu                    */
  1010.                                     Boolean checked);            /*Place check mark beside the menu item?        */
  1011.  
  1012. /*Mark a Pop-Up Menu item with a specified character (√ or •, etc)*/
  1013.     pascal void PopUpMark (short MenuNumber,                    /*Pop-Up Menu number                            */
  1014.                                     short ItemNumber,            /*Item number within the menu                    */
  1015.                                     char markChar);                /*Menu item's character                            */
  1016.  
  1017. /*Get a Pop-Up Menu item's ‘mark’ character (√ or •, etc) which is optionally displayed at the item's left side*/
  1018.     pascal void GetPopUpMark (short MenuNumber,                    /*Pop-Up Menu number                            */
  1019.                                     short ItemNumber,            /*Item number within the menu                    */
  1020.                                     char *markChar);            /*Menu item's character                            */
  1021.  
  1022. /*Specify an icon to be displayed by a Pop-Up Menu item*/
  1023.     pascal void PopUpIcon (short MenuNumber,                    /*Pop-Up Menu number                            */
  1024.                                     short ItemNumber,            /*Item number within the menu                    */
  1025.                                     short IconSelector);        /*IconSelector + 256 = cicn or ICON ID            */
  1026.  
  1027. /*Get the specifier for the icon that is displayed by a Pop-Up Menu item*/
  1028.     pascal void GetPopUpIcon (short MenuNumber,                    /*Pop-Up Menu number                            */
  1029.                                     short ItemNumber,            /*Item number within the menu                    */
  1030.                                     short *IconSelector);        /*IconSelector + 256 = cicn or ICON ID            */
  1031.  
  1032. /*Set the character style for a Pop-Up Menu item*/
  1033.     pascal void PopUpStyle (short MenuNumber,                    /*Pop-Up Menu number                            */
  1034.                                     short ItemNumber,            /*Item number within the menu                    */
  1035.                                     Style theStyle);            /*Menu item's character style                    */
  1036.  
  1037. /*Determine the number of items in a Pop-Up Menu*/
  1038.     pascal short PopUpItemCount (short MenuNumber                /*Pop-Up Menu number                            */
  1039.                                     );                            /* = Number of items in the menu                */
  1040.  
  1041. /*Determine the selected item in a Pop-Up Menu*/
  1042.     pascal short GetPopUpSelection (short MenuNumber            /*Pop-Up Menu number                            */
  1043.                                     );                            /*Selected item in the menu                        */
  1044.  
  1045.  
  1046.  
  1047. /*=============================================== C U R S O R S ===============================================    */
  1048. /*Change the cursor shape*/
  1049.     pascal void CursorShape (short CursorType);                 /*Cursor type                                    */
  1050.  
  1051. /*Reset the cursor to its appropriate shape depending on its location in the active window.*/
  1052.     pascal void ResetCursor(void);
  1053.  
  1054. /*Create a new Cursor Table*/
  1055.     pascal void NewCursorTable (short CursorTable,                /*Cursor table number                            */
  1056.                                     short CursorType);            /*Cursor type                                    */
  1057.  
  1058. /*Delete a Cursor Table*/
  1059.     pascal void DeleteCursorTable (short CursorTable);            /*Cursor table number                            */
  1060.  
  1061. /*Add a new Cursor Zone to a Cursor Table, or replace an existing Cursor Zone*/
  1062.     pascal void CursorZone (short CursorTable,                    /*Cursor table number                            */
  1063.                                     short CursorZone,            /*Cursor zone number                            */
  1064.                                     short CursorType,            /*Cursor type                                    */
  1065.                                     short left,                    /*Cursor zone's co-ordinates (local)            */
  1066.                                     short top,                    /*                                                */
  1067.                                     short right,                /*                                                */
  1068.                                     short bottom);                /*                                                */                        
  1069.  
  1070. /*Add a new Cursor Zone to a Cursor Table, or replace an existing Cursor Zone (co-ordinates specified as a 'rect') */
  1071.     pascal void CursorZoneRect (short CursorTable,                /*Cursor table number                            */
  1072.                                     short CursorZone,            /*Cursor zone number                            */
  1073.                                     short CursorType,            /*Cursor type                                    */
  1074.                                     Rect *Bounds);                /*Cursor zone's co-ordinates (local)            */
  1075.  
  1076. /*Add a new Cursor Zone to a Cursor Table, or replace an existing Cursor Zone (co-ordinates specified as a 'region') */
  1077.     pascal void CursorZoneRgn (short CursorTable,                /*Cursor table number                            */
  1078.                                     short CursorZone,            /*Cursor zone number                            */
  1079.                                     short CursorType,            /*Cursor type                                    */
  1080.                                     RgnHandle ZoneRgn);            /*Cursor zone's region (local)                    */
  1081.  
  1082. /*Indicate that the cursor shape may have to be recalculated due to manually altering Cursor Zone regions.        */
  1083.     pascal void ChangedCursorZone(void);
  1084.  
  1085. /*Delete a Cursor Zone*/
  1086.     pascal void DeleteCursorZone (short CursorTable,            /*Cursor table number                            */
  1087.                                     short CursorZone);            /*Cursor zone number                            */
  1088.  
  1089. /*Get the co-ordinates of a specified Cursor Zone*/
  1090.     pascal void GetCursorZone (short CursorTable,                /*Cursor table number                            */
  1091.                                     short CursorZone,            /*Cursor zone number                            */
  1092.                                     Rect *Bounds);                /*Cursor zone's co-ordinates (local)            */
  1093.  
  1094. /*Get a Cursor Zone's region*/
  1095.     pascal RgnHandle GetCursorZoneRgn (short CursorTable,        /*Cursor table number                            */
  1096.                                        short CursorZone            /*Cursor zone number                            */
  1097.                                        );                            /* = Handle to Cursor region (local)            */
  1098.  
  1099. /*Make the current window use a specified Cursor Table*/
  1100.     pascal void UseCursorTable (short CursorTable);                /*Cursor table number                            */
  1101.  
  1102. /*Find the cursor zone that contains a specified point*/
  1103.     pascal short FindCursorZone (Point thePoint                    /*Location in window's local co-ordinates        */
  1104.                                     );                            /* = Cursor zone number containing the point    */
  1105.  
  1106. /*Enable/disable clicks on push-buttons when the watchCursor is displayed*/
  1107.     pascal void WatchCursorButtons (Boolean Allowed);            /*Can push-buttons be clicked when the            */
  1108.                                                                 /*    watchCursor is displayed?                    */
  1109.  
  1110.  
  1111.  
  1112. /*=============================================== P O L L I N G ===============================================    */
  1113. /*Tools Plus polling procedure*/
  1114.     pascal Boolean PollSystem (TPPollRecord *Poll                /*Polling record                                */
  1115.                                     );                            /* = Did an event occurred?                        */
  1116.  
  1117. /*Set the number of ticks (1/60 sec) your application can wait until it receives a doNothing event.*/
  1118.     pascal void SetNullTime (long ForegroundTime,                /*Duration when application is active            */
  1119.                                        long BackgroundTime);        /*Duration when application is suspended        */
  1120.  
  1121. /*Determine if "waiting for doNothing events" (timed doNothing events) is supported.*/
  1122.     pascal Boolean WaitAvail(void);                                /*Is waiting between doNothing events supported?*/
  1123.  
  1124. /*Determine if the application is 'suspended' (ie: this is not the active application)*/
  1125.     pascal Boolean ApplicationSuspended(void);                    /*Is the application suspended?                    */
  1126.  
  1127. /*Clear the mouse's current click or drag (ie: discontinue the process, clear the event*/
  1128.     pascal void ResetMouseClicks(void);
  1129.  
  1130.  
  1131.  
  1132. /*========================================= C O L O R   D R A W I N G =========================================    */
  1133. /*Determine if the Macintosh has color QuickDraw*/
  1134.     pascal Boolean HasColorQuickDraw(void);                        /*Does the Mac have color QuickDraw                */
  1135.  
  1136. /*Determine the number of logical screens (distinct screen depth and color/gray settings)*/
  1137.     pascal short NumberOfScreens(void);                            /*Number of logical screens available            */
  1138.  
  1139. /*Begin updating the specified logical screen*/
  1140.     pascal void BeginUpdateScreen (short TheScreen);            /*Logical screen number                            */
  1141.  
  1142. /*End updating the most recent logical screen*/
  1143.     pascal void EndUpdateScreen(void);
  1144.  
  1145. /*Determine the logical screen's depth*/
  1146.     pascal short ScreenDepth(void);                                /*Screen depth in bits                            */
  1147.  
  1148. /*Determine if the logical screen is set to display in color*/
  1149.     pascal Boolean ScreenHasColors(void);                        /*Is the screen set to display in color?        */
  1150.  
  1151. /*Color equivalent to 'PenNormal' routine*/
  1152.     pascal void PenColorNormal(void);
  1153.  
  1154. /*Color equivalent to 'GetPenState' routine*/
  1155.     pascal void GetColorPenState (ColorPenState *ThePenState);
  1156.  
  1157. /*Color equivalent to 'SetPenState' routine*/
  1158.     pascal void SetColorPenState (ColorPenState *ThePenState);
  1159.  
  1160.  
  1161.  
  1162. /*===================================== U S E R    N O T I F I C A T I O N ====================================    */
  1163. /*Define the settings for notifying the user.*/
  1164.     pascal void SetNotification (short IconID,                    /*'SICN' icon ID displayed during notification    */
  1165.                                     short SoundID,                /*Sound ID that is played at notification        */
  1166.                                     Str255 Message,                /*Message displayed during notification            */
  1167.                                     Boolean ResetAfterUse);        /*Revert settings to defaults after notification*/
  1168.  
  1169. /*If this application is inactive, inform user that this application needs attention.*/
  1170.     pascal Boolean PostNotification(void);                        /*Was the user notified?                        */
  1171.  
  1172.  
  1173.  
  1174. /*========================================= M I S C E L L A N E O U S =========================================    */
  1175. /*Determine the System file version*/
  1176.     pascal double SystemVersion(void);                            /*System file version (eg 7.0.1 seen as 7.01)    */
  1177.  
  1178. /*Draw an icon (ICON, ICN#, icl8, icl4, and cicn)*/
  1179.     pascal void DrawIcon (short theIcon,                        /*Icon ID number                                */
  1180.                                     short left,                    /*Icon's top-left corner (local)                */
  1181.                                     short top,                    /*                                                */
  1182.                                     Boolean EnabledFlag,        /*Enable the icon?                                */
  1183.                                     Boolean SelectedFlag);        /*Select the icon?                                */
  1184.  
  1185. /*Specify the default appearance for disabled icons*/
  1186.     pascal void DefaultIconLook (short IconSpec);                /*Appearance specifications                        */
  1187.  
  1188. /*Draw a standard Macintosh progress thermometer*/
  1189.     pascal void DrawThermometer (Rect *DisplayRect,                /*Thermometer's co-ordinates (local)            */
  1190.                                     float Percent);                /*Percent complete (ie: .5 means 50%)            */
  1191.  
  1192. /*Display a dynamic Alert Box and return the use's action*/
  1193.     pascal short AlertBox (short theIcon,                        /*Icon ID number                                */
  1194.                                     Str255 AlertText,            /*Alert's text                                    */
  1195.                                     long AlertCode                /*Button setup codes                            */
  1196.                                     );                            /* = Button clicked by user                        */
  1197.  
  1198. /*Change a button name for the next use of the dynamic Alert Box*/
  1199.     pascal void AlertButtonName (short Button,                    /*Button number from 1 to 9                        */
  1200.                                     Str255 Title);                /*Button's title                                */
  1201.  
  1202. /*Draw "zoom" lines (expanding/collapsing rectangle)*/
  1203.     pascal void ZoomLines (Rect *OldRect,                        /*Starting rectangle (global co-ordinates)        */
  1204.                                     Rect *NewRect,                /*Ending rectangle (global co-ordinates)        */
  1205.                                     short Zoom);                /*Zoom across, in, or out                        */
  1206.  
  1207. /*Play the System Error sound*/
  1208.     pascal void Beep(void);
  1209.  
  1210. /*Wait for a specified duration*/
  1211.     pascal void Wait (long ClockTicks);                            /*Number of ticks (1/60th sec) to wait            */
  1212.  
  1213. /*Determine the minimum value of 2 numbers*/
  1214.     pascal long min (long Val1, long Val2);
  1215.  
  1216. /*Determine the maximum value of 2 numbers*/
  1217.     pascal long max (long Val1, long Val2);
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223. #ifdef __cplusplus
  1224. }
  1225. #endif
  1226. #endif /* __ToolsPlus__ */
  1227.